class Term {
  _id
  en_short
  en_full
  cn_short
  cn_full
  desc

  constructor(args) {
    this.en_short = args.en_short;
    this.en_full = args.en_full;
    this.cn_short = args.cn_short;
    this.cn_full = args.cn_full;
    this.desc = args.desc;
    this._id = args._id;
  }
}

Term.query = function (words) {
  return !words ? {} : {
    en_short: {
      $regex: words,
      $options: 'im'
    },
    en_full: {
      $regex: words,
      $options: 'im'
    },
    cn_short: {
      $regex: words,
      $options: 'im'
    },
    cn_full: {
      $regex: words,
      $options: 'im'
    },
    desc: {
      $regex: words,
      $options: 'im'
    },
  };
}
module.exports = Term
